package com.wxc.api.admin.service.impl;

import com.wxc.api.admin.entity.Files;
import com.wxc.api.admin.mapper.FilesMapper;
import com.wxc.api.admin.service.IFilesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 文件表 服务实现类
 * </p>
 *
 * @author baomidou
 * @since 2022-05-09
 */
@Service
public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements IFilesService {

    @Autowired
    private FilesMapper filesMapper;

    @Override
    public Integer add(String filename, Long size, String path, String ext) {

        Files files = new Files();
        files.setFilename(filename);
        files.setSize(size);
        files.setPath(path);
        files.setExt(ext);

        return filesMapper.insert(files);
    }

}
